﻿<%@ Page Language="C#" MasterPageFile="~/Manage/MainPage.master"  AutoEventWireup="true" CodeFile="OrdersManage.aspx.cs" Inherits="Manage_OrdersManage" %>
<%@ Import Namespace="Shopping.Common" %>
<%@ Import Namespace="Shopping.Model" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
<script type="text/javascript" src="/JsBase/AppHelper/AreaHelper.js"></script>
<script type="text/javascript" src="/Manage/Public/SelectGoods.js"></script>
<script type="text/javascript" src="/Manage/Js/OrdersManage.js"></script>
<script type="text/javascript">
    SelectOptionOfSendMode = '<%=SelectOptionOfSendMode %>';
    SelectOptionOfPayMode = '<%=SelectOptionOfPayMode %>';
    SelectOptionOfStatus = '<%=SelectOptionOfStatus %>';
    SelectOptionOfProvince = '<%=SelectOptionOfProvince %>';
    ModelOfOrder = <%=JSONHelper.ObjectToJson<OrderInfo>(new OrderInfo()) %>;
    ModelOfLine = <%=JSONHelper.ObjectToJson<OrderLineInfo>(new OrderLineInfo()) %>;
    CurDate = '<%=DateTime.Now.ToString("yyyy-MM-dd") %>';
</script>


<table width="99%" border="0" cellspacing="0" cellpadding="0" class="table" align="center">
  <tr>
    <td align="center">
	
	<img src="/Manage/Images/sousuo.gif" />订单号：
      <input name="txtKeyWordsOfSearch" type="text" id="txtKeyWordsOfSearch" size="15" value="<%=q.OrderID %>"  class="border6"/>
      会员名：
      <input name="txtUserNameOfSearch" type="text" id="txtUserNameOfSearch" size="12"  class="border6" value="<%=q.UserName %>"/>
        支付方式：
        <select name="ddlPayModeOfSearch" id="ddlPayModeOfSearch">
          <option value="">-不限-</option>
          <%=SelectOptionOfPayMode %>
        </select>
        送货方式：
        <select name="ddlSendModeOfSearch" id="ddlSendModeOfSearch">
          <option value="">-不限-</option>
           <%=SelectOptionOfSendMode %>
        </select>
        订单日期：   
        <input name="txtStartDateOfSearch" type="text" id="txtStartDateOfSearch"  value="<%=q.StartDate %>"   size="12" maxlength="12" readonly="readonly"
                        onfocus="new WdatePicker({el:this})"  class=" Wdate" style="cursor: hand"/>
      -
      <input name="txtEndDateOfSearch" type="text" id="txtEndDateOfSearch"  size="12" maxlength="12" readonly="readonly"
                        onfocus="new WdatePicker({el:this})"  value="<%=q.EndDate %>" class=" Wdate" style="cursor: hand"/>
&nbsp;订单状态： 
              <select name="ddlStatusOfSearch" id="ddlStatusOfSearch">
         <option value="">--不限--</option>
         <%=SelectOptionOfStatus %>
       </select>&nbsp;
             <input name="btnSearch" type="button" id="btnSearch" value="搜 索" class="btn1" onclick="GoToSearch();" />        [ <a href="OrdersManage.aspx" class="red bold">查看全部</a> ]	</td>
  </tr>
</table>
  <br />
<table width="99%" border="0" cellspacing="0" cellpadding="0" class="table" align="center">
  <tr>
    <td colspan="10" align="left" class="HeadTitle">&gt;&gt;订单管理</td>
  </tr>
  <tr class="TableHeadRow">
    <td width="120" align="center">订单号 </td>
    <td width="120" align="center">订单日期<a href="<%=Utility.GetNewUrl("Sorts","0",false) %>">↓</a><a href="<%=Utility.GetNewUrl("Sorts","1",false) %>">↑</a></td> 
    <td width="95" align="center">订单金额<a href="<%=Utility.GetNewUrl("Sorts","2",false) %>">↓</a><a href="<%=Utility.GetNewUrl("Sorts","3",false) %>">↑</a></td>
    <td align="center">会员</td>
    <td align="center">收货人</td>
    <td align="center">收货地址</td>
    <td width="80" align="center">支付方式</td>
    <td width="80" align="center">送货方式</td>
    <td width="80" align="center">订单状态</td>
    <td width="120" align="center">管理 [<a href="javascript:Add();">+新订单</a>]</td>
  </tr>
  <%
      if (listOfOrders != null)
      {
          for (int i = 0; i < listOfOrders.Count; ++i)
          {
              OrderInfo o = listOfOrders[i]; 
  %>
  <tr onmouseover="this.style.backgroundColor='#F2F2F2';" onmouseout="this.style.backgroundColor='#FFFFFF';" >
    <td align="center"><a href="javascript:Edit(<%=o.Order.OrderID %>)"><%=o.Order.OrderID %></a></td>
    <td align="center"><%=o.Order.OrderDate.ToString("yyyy-MM-dd") %></td>
    <td align="center"><%=Utility.FormatMoneyStr( o.Order.TotalAmount) %></td>
    <td align="center"><a href="<%=Utility.GetNewUrl("UserName",o.UserName,false) %>" title="点击查看该会员所有订单"><%=o.UserName %></a></td>
    <td align="center"><%=o.Order.ReceiverName %></td>
    <td align="center"><%=o.Order.ReceiverAddress %></td>
    <td align="center"><a href="<%=Utility.GetNewUrl("PayMode",o.Order.PayMode,false) %>" title="点击查看该支付模式下所有订单"><%=o.Order.PayMode %></a></td>
    <td align="center"><a href="<%=Utility.GetNewUrl("SendMode",o.Order.SendMode,false) %>" title="点击查看该送货模式下所有订单"><%=o.Order.SendMode %></a></td>
    <td align="center"><%=o.Order.OrderStatus %></td>
    <td align="center">[<a href="javascript:Edit(<%=o.Order.OrderID %>)">订单维护</a>]  
    
    <%if (o.Order.OrderStatus == OrderStatus.等待付款.ToString())
      { %>
    [<a href="javascript:Delete(<%=o.Order.OrderID %>)" class="red">删除</a>]
     <%}
      else
      { %>
      [<a href="javascript:alert('系统提示：该订单不允许被删除！');" class="red" disabled>删除</a>]
      <%} %>
    
     </td>
  </tr>
  <%} %>
  <tr>
    <td colspan="10" align="center">
     <span class="page" >
       <%=Utility.GetPageLine(Utility.GetWebPageUrlNoCurPage(), q.CurPage, q.PageSize,10, q.TotalCount)%>        </span>    </td>
  </tr>
  <%}
      else
      { %>
  <tr>
    <td colspan="10" align="center"><span class="red">[ 未找到任何订单信息！]</span></td>
    </tr>
    <%} %>
</table>

</asp:Content>
